package com.bdzl.api;

import com.bdzl.api.impl.LoginCheckApiFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * 用户登录验证接口
 * 检验登录状态
 * 获取用户数据
 * 获取权限等接口
 * @author yuxue
 * @date 2019-08-08 , fallback = LoginCheckApiFallback.class
 */
@FeignClient(value = "loanAuth", contextId = "LoginCheckApi", fallback = LoginCheckApiFallback.class,url = "${feign.sys}:8002")
public interface LoginCheckApi {

	/**
	 * 根据Token，判断是否登录
	 * @return
	 */
	@PostMapping(value="/check/checkLogin")
	Object checkLogin();

	@PostMapping(value="/check/getUserInfo")
	Object getUserInfo();

	/**
	 * 根据请求url，判断是否有权限
	 * 需要先判断是否登录
	 * @return
	 */
	@PostMapping(value="/check/checkPermission")
	Object checkPermission(@RequestParam("token")String token, @RequestParam("checkUrl")String checkUrl);


	@PostMapping(value="/check/getPermission")
	Object getPermission(@RequestParam("module")String module, @RequestParam("userEntity")String userEntity);

}
